package cate.game.activity.zonelimit.msg;

import cate.game.GameBody;
import cate.game.activity.zonelimit.po.RoleZoneLimit;
import cate.game.client.ClientContext;
import cate.game.client.msg.ClientMsg;
import cate.game.client.msg.MsgConfig;
import cate.game.client.msg.MsgInput;
import cate.game.client.msg.id.MsgIdBZoneLimit;
import easy.java.dev.note.NoteField;


@ClientMsg(title = "单个全服限购活动数据 の 请求")
public class ZoneLimitReq implements MsgInput {

    @NoteField("功能id")
    public int funcId;


    @Override
    public void execute(GameBody game, ClientContext cc) {
        RoleZoneLimit data = cc.getRole().getActivity().getActivitySingle(funcId);
        if (data != null) {
            data.noticeUpdate();
        } else {
            cc.getRole().getGame().notice.message(cc.getRole(), "活动未开启");
        }
    }

    @Override
    public MsgConfig conf() {
        return MsgIdBZoneLimit.DATA_REQ;
    }
}
